FROM golang:1.17

ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn

RUN go mod download

WORKDIR /opt/go-gin-api

ADD .  /opt/go-gin-api

RUN go build -o main ./main.go

EXPOSE 5002

CMD ["/opt/go-gin-api/main"]
